<ion-header>
  <ion-navbar>
    <ion-title>工资</ion-title>
    <ion-buttons end>
      <button ion-button icon-only (click)="ionViewDidLoad()">
        <i class="fa fa-search"></i>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content>

  <ion-list>
    <ion-item class="w06">
      <ion-label>日期始:</ion-label>
      <ion-datetime displayFormat="YYYY-MM-DD" pickerFormat="YYYY-MM-DD" doneText="确定" cancelText="取消"
                    [(ngModel)]="timeStarts" (ngModelChange)="ionViewDidLoad()"></ion-datetime>
    </ion-item>
    <ion-item class="w06">
      <ion-label>日期止:</ion-label>
      <ion-datetime displayFormat="YYYY-MM-DD" pickerFormat="YYYY-MM-DD" doneText="确定" cancelText="取消"
                    [(ngModel)]="timeEnds" (ngModelChange)="ionViewDidLoad()"></ion-datetime>
    </ion-item>
    <ion-item class="mt15">
      <ion-label class="text_hide_none">
        <span class="w08">当前总工资为:{{costItems.SUMGDHS || 0}}</span>

        <!--<div class="w04 fr tr font_size_large font_red font_weight_bold">
          ￥{{data.JE}}
        </div>
        <span class="w08 mt5 font_gray">完工时间:{{data.RETURNED}}</span>-->
      </ion-label>
    </ion-item>
    <div class="jl_line"></div>
    <ion-item class="mt15">
      <ion-label>分类核算：</ion-label>
    </ion-item>
    <ng-container *ngFor="let group of listGroup">
      <ion-item>
        <ion-label class="text_hide_none">
          <span class="w08"><span class="font_gray">类型：</span>{{group.EXTFLNAME}}</span>
          <span class="w08"><span class="font_gray">对应工资：</span>{{group.SUMTOTAL}}</span>
        </ion-label>
      </ion-item>
      <!-- <ion-item *ngFor="let product of data.SPLB">
         <ion-label class="mt10 mb10 text_hide_none">
           <span class="w10">{{product.PRODUCT_NAME}}</span>
           <span class="w02 tr font_gray">× {{product.NUM}}</span>
         </ion-label>
       </ion-item> -->
    </ng-container>
    <div class="jl_line"></div>
    <!--<ng-container *ngFor="let costItem of costItems;let i = index">-->
    <ion-item class="mt15">
      <ion-label>工资明细：</ion-label>
    </ion-item>
    <ng-container *ngFor="let item of costItems.GDMX;let j = index">
      <ion-item>
        <ion-label class="text_hide_none">
            <span class="w12">
              <span class="w06"><span class="font_gray">工单工资：</span>{{item.GDHS}}</span>
              <span class="w06"><span class="font_gray">工单号：</span>{{item.ID}}</span>
            </span>
          <span class="w12 ">
              <span class="w06"> <span class="font_gray">业务单号：</span>{{item.WBDH||''}}</span>
              <span class="w06"> <span class="font_gray">完工时间：</span>{{item.WGSJ}}</span>
            </span>
          <span class="w12">
              <span class="w06"> <span class="font_gray">客户：</span>{{item.NAME}}</span>
              <span class="w06"> <span class="font_gray">联系电话：</span>{{item.MOBILE}}</span>
            </span>
          <span class="w12"> <span class="font_gray">地址：</span>{{item.KHDZ}}</span>
          <span class="w12 mt15">
              <ng-container *ngFor="let FY of item.FYMX;let k = index">
                <span class="w12">{{FY.FYMC}}:{{FY.FYJE}}</span>
              </ng-container>
            </span>
        </ion-label>
      </ion-item>
    </ng-container>

    <!--</ng-container>-->
  </ion-list>
  <div *ngIf="datasConfig.isEnd==true" class="w12 mt20 mb20 tc font_gray">------------------------ 已经到底了
    ------------------------
  </div>
  <ion-infinite-scroll (ionInfinite)="getMoreDatas($event)" threshold="100px" [enabled]="!datasConfig.isEnd">
    <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="数据加载中...">
    </ion-infinite-scroll-content>
  </ion-infinite-scroll>
</ion-content>
